package com.atguigu.gulimall.order.mapper;

import com.atguigu.gulimall.order.entity.OrderInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author nicc
* @description 针对表【order_info(订单表 订单表)】的数据库操作Mapper
* @createDate 2022-10-19 02:39:49
* @Entity com.atguigu.gulimall.order.entity.OrderInfo
*/
@Mapper
public interface OrderInfoMapper extends BaseMapper<OrderInfo> {

    /**
     * 利用 CAS思想  实现 轻量级乐观锁 - 幂等性关单
     * @param expectOrderStatus
     * @param expectProcessStatus
     * @param orderStatus
     * @param processStatus
     * @param orderId
     * @param userId
     */
    void updateOrderStatusByCAS(@Param("expectOrderStatus") List<String> expectOrderStatus,
                                @Param("expectProcessStatus") List<String> expectProcessStatus,
                                @Param("orderStatus") String orderStatus,
                                @Param("processStatus") String processStatus,
                                @Param("orderId") Long orderId,
                                @Param("userId") Long userId);

}




